package com.test;

public class test02 {
    public static void main(String[] args) {
        son_two st = new son_two();
        st.test();
    }
}

class father_two{
    public void eat()
    {
        System.out.println("father eat");
    }
    public void drink()
    {
        System.out.println("father drink");
    }
}

class son_two extends father_two{
    @Override
    public void eat()
    {
        System.out.println("son eat");
    }
    @Override
    public void drink()
    {
        System.out.println("son drink");
    }

    public void test()
    {

        //this就近原则调用本类的方法
        this.eat();
        this.drink();
        //super调用父类方法
        super.eat();
        super.drink();
    }

}
